package com.ljx.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 系统通知表
 * @TableName e_message
 */
@TableName(value ="e_message")
@Data
public class Message implements Serializable {
    /**
     * 通知id
     */
    @TableId
    @ApiModelProperty(name = "id",value = "通知id", dataType = "String")
    private String id;

    /**
     * 发送日期
     */
    @ApiModelProperty(name = "gmtDate",value = "发送日期", dataType = "Date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date gmtDate;

    /**
     * 管理员id
     */
    @ApiModelProperty(name = "eid",value = "管理员id", dataType = "String")
    private String eid;

    /**
     * 发送类型编号
     */
    @ApiModelProperty(name = "stype",value = "发送类型编号", dataType = "Integer")
    private Integer stype;

    /**
     * 发送内容
     */
    @ApiModelProperty(name = "scontend",value = "发送内容", dataType = "String")
    private String scontend;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @ApiModelProperty(name = "isDeleted",value = "逻辑删除 1（true）已删除， 0（false）未删除", dataType = "Integer")
    @TableLogic
    private Integer isDeleted;

    @TableField(exist = false)
    @ApiModelProperty(name = "empInfo",value = "发布人信息", dataType = "EmpInfo")
    private EmpInfo empInfo;

    @TableField(exist = false)
    @ApiModelProperty(name = "msgType",value = "公告类型", dataType = "MsgType")
    private MsgType msgType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Message other = (Message) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGmtDate() == null ? other.getGmtDate() == null : this.getGmtDate().equals(other.getGmtDate()))
            && (this.getEid() == null ? other.getEid() == null : this.getEid().equals(other.getEid()))
            && (this.getStype() == null ? other.getStype() == null : this.getStype().equals(other.getStype()))
            && (this.getScontend() == null ? other.getScontend() == null : this.getScontend().equals(other.getScontend()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGmtDate() == null) ? 0 : getGmtDate().hashCode());
        result = prime * result + ((getEid() == null) ? 0 : getEid().hashCode());
        result = prime * result + ((getStype() == null) ? 0 : getStype().hashCode());
        result = prime * result + ((getScontend() == null) ? 0 : getScontend().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", gmtDate=").append(gmtDate);
        sb.append(", eid=").append(eid);
        sb.append(", stype=").append(stype);
        sb.append(", scontend=").append(scontend);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}